﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Maticsoft.Common;

namespace Maticsoft.Web.wap.ashx
{
    /// <summary>
    /// order 的摘要说明
    /// </summary>
    public class order : IHttpHandler
    {

        public void ProcessRequest( HttpContext context )
        {
            context.Response.ContentType = "text/plain";
            int orderid = DigitHelper.GetInt32(context.Request.QueryString["orderid"]);
            string op = context.Request.QueryString["op"];

            if (op == "confirm")
            {
                context.Response.Write(Confirm(orderid));
                context.Response.End();
            }
        }

        private string Confirm( int id )
        {
            BLL.Orders ordBLL = new BLL.Orders();
            Model.Orders ordModel = ordBLL.GetModel(id);
            ordModel.Status = 5;
            ordModel.UpdateTime = DateTime.Now;
            ordBLL.Update(ordModel);
            return "1";
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}